﻿/***********************************************************************
 * <copyright file="IModel.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Tuanhm
 * Email:    Tuanhm@humg@gmail.com
 * Website:
 * Create Date: Thursday, March 27, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System;
using System.Collections.Generic;
using WindowsForms.AOnline.Model.BusinessObjects.Dictionary;
using WindowsForms.AOnline.Model.BusinessObjects.Deposit;
using WindowsForms.AOnline.Model.BusinessObjects.Dictionary;
using WindowsForms.AOnline.Model.BusinessObjects.Inventory;
using WindowsForms.AOnline.Model.BusinessObjects.Report;
using WindowsForms.AOnline.Model.BusinessObjects.Report.Stock;


namespace WindowsForms.AOnline.Model
{
    /// <summary>
    /// Interface IModel
    /// </summary>
    public interface IModel
    {
        #region ItemTransaction
        /// <summary>
        /// Gets the deposit.
        /// </summary>
        /// <param name="refNo">The reference no.</param>
        /// <returns></returns>
        ItemTransactionModel GetItemTransactionVoucher(string refNo);

        int GetPageSizeItemTransactions(int refTypeId);  
        /// <summary>
        /// Gets the receipt voucher by reference type identifier.
        /// </summary>
        /// <param name="refTypeId">The reference type identifier.</param>
        /// <returns></returns>
        IList<ItemTransactionModel> GetItemTransactionVoucherByRefTypeId(int refTypeId, int page);

        /// <summary>
        /// Gets the receipt voucher.
        /// </summary>
        /// <param name="itemTransactionId">The payment voucher identifier.</param>
        /// <returns></returns>
        ItemTransactionModel GetItemTransactionVoucher(long itemTransactionId);

        /// <summary>
        /// Adds the receipt voucher.
        /// </summary>
        /// <param name="itemTransaction">The payment voucher.</param>
        /// <returns></returns>
        string AddItemTransactionVoucher(ItemTransactionModel itemTransaction);

        /// <summary>
        /// Updates the receipt voucher.
        /// </summary>
        /// <param name="itemTransaction">The payment voucher.</param>
        /// <returns></returns>
        string UpdateItemTransactionVoucher(ItemTransactionModel itemTransaction);

        /// <summary>
        /// Deletes the receipt voucher.
        /// </summary>
        /// <param name="itemTransactionId">The payment voucher identifier.</param>
        /// <returns></returns>
        string DeleteItemTransactionVoucher(long itemTransactionId);


        #endregion

        #region Account  

        int GetPageSizeAccounts();


        /// <summary>
        /// Gets the accounts.
        /// </summary>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccountsInventoryItem();


        IList<AccountModel> GetAllAccounts(); 


        /// <summary>
        /// Gets the accounts.
        /// </summary>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccountsAccountingObject(); 

        /// <summary>
        /// Gets the accounts.
        /// </summary>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccountsTax(); 


        /// <summary>
        /// Gets the accounts.
        /// </summary>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccountsFixedasset();
        /// <summary>
        /// Gets the accounts.
        /// </summary>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccounts(int currentPage);

        /// <summary>
        /// Gets the accounts for combo tree.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        /// <returns>IList{AccountModel}.</returns>
        IList<AccountModel> GetAccountsForComboTree(int accountId);

        /// <summary>
        /// Gets the account.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        /// <returns>AccountModel.</returns>
        AccountModel GetAccount(int accountId);

        /// <summary>
        /// Adds the account.
        /// </summary>
        /// <param name="account">The account.</param>
        /// <returns>System.Int32.</returns>
        string AddAccount(AccountModel account);

        /// <summary>
        /// Updates the account.
        /// </summary>
        /// <param name="account">The account.</param>
        /// <returns>System.Int32.</returns>
        string UpdateAccount(AccountModel account);

        /// <summary>
        /// Deletes the account.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteAccount(int accountId);

        #endregion

        #region RefType

        /// <summary>
        /// Gets the reference types.
        /// </summary>
        /// <returns></returns>
        IList<RefTypeModel> GetRefTypes();

        #endregion

        #region VoucherType

        /// <summary>
        /// Gets the voucher types.
        /// </summary>
        /// <returns></returns>
        IList<VoucherTypeModel> GetVoucherTypes();

        /// <summary>
        /// Gets the voucher types active.
        /// </summary>
        /// <returns></returns>
        IList<VoucherTypeModel> GetVoucherTypesActive();

        #endregion

        #region DBOption


        IList<DbOptionModel> GetDbOptions();


        /// <summary>
        /// Updates the database option.
        /// </summary>
        /// <param name="dbOptions">The database options.</param>
        /// <returns></returns>
        string UpdateDbOption(List<DbOptionModel> dbOptions);

        #endregion

        #region EmployTest 


        int GetPageSizeEmployTests();  
        /// <summary>
        /// Gets the Employs.
        /// </summary>
        /// <returns>IList{EmployModel}.</returns>
        IList<EmployTestModel> GetEmployTests(int currentPage);
        /// <summary>
        /// Gets the Employ.
        /// </summary>
        /// <param name="employId">The Employ identifier.</param>
        /// <returns>EmployModel.</returns>
        EmployTestModel GetEmploy(int employId);

        /// <summary>
        /// Adds the Employ.
        /// </summary>
        /// <param name="employ">The Employ.</param>
        /// <returns>System.Int32.</returns>
        string AddEmploy(EmployTestModel employ);

        /// <summary>
        /// Updates the Employ.
        /// </summary>
        /// <param name="employ">The Employ.</param>
        /// <returns>System.Int32.</returns>
        string UpdateEmploy(EmployTestModel employ);

        /// <summary>
        /// Deletes the Employ.
        /// </summary>
        /// <param name="employId">The Employ identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteEmploy(int employId);
        #endregion

        #region AutoBusiness
        int GetPageSizeAutoBusinesss(); 
        /// <summary>
        /// Gets the AutoBusinesss.
        /// </summary>
        /// <returns>IList{AutoBusinessModel}.</returns>
        IList<AutoBusinessModel> GetAutoBusinesss(int currentPage);

        IList<AutoBusinessModel> GetAllAutoBusinesss();
        /// <summary>
        /// Gets the AutoBusiness.
        /// </summary>
        /// <param name="autoBusinessId">The AutoBusiness identifier.</param>
        /// <returns>AutoBusinessModel.</returns>
        AutoBusinessModel GetAutoBusiness(int autoBusinessId);

        /// <summary>
        /// Adds the AutoBusiness.
        /// </summary>
        /// <param name="autoBusiness">The AutoBusiness.</param>
        /// <returns>System.Int32.</returns>
        string AddAutoBusiness(AutoBusinessModel autoBusiness);

        /// <summary>
        /// Updates the AutoBusiness.
        /// </summary>
        /// <param name="autoBusiness">The AutoBusiness.</param>
        /// <returns>System.Int32.</returns>
        string UpdateAutoBusiness(AutoBusinessModel autoBusiness);

        /// <summary>
        /// Deletes the AutoBusiness.
        /// </summary>
        /// <param name="autoBusinessId">The AutoBusiness identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteAutoBusiness(int autoBusinessId);
        #endregion

        #region AutoNumber
        /// <summary>
        /// Gets the type of the automatic number by reference.
        /// </summary>
        /// <param name="refType">Type of the reference.</param>
        /// <returns>AutoNumberModel.</returns>
        AutoNumberModel GetAutoNumberByRefType(int refType);

        int GetPageSizeAutoNumbers();
        /// <summary>
        /// Gets the AutoNumbers.
        /// </summary>
        /// <returns>IList{AutoNumberModel}.</returns>
        IList<AutoNumberModel> GetAutoNumbers(int currentPage);
        /// <summary>
        /// Gets the AutoNumber.
        /// </summary>
        /// <param name="autoNumberId">The AutoNumber identifier.</param>
        /// <returns>AutoNumberModel.</returns>
        AutoNumberModel GetAutoNumber(int autoNumberId);

        /// <summary>
        /// Adds the AutoNumber.
        /// </summary>
        /// <param name="autoNumber">The AutoNumber.</param>
        /// <returns>System.Int32.</returns>
        string AddAutoNumber(AutoNumberModel autoNumber);

        /// <summary>
        /// Updates the AutoNumber.
        /// </summary>
        /// <param name="autoNumber">The AutoNumber.</param>
        /// <returns>System.Int32.</returns>
        string UpdateAutoNumber(AutoNumberModel autoNumber);

        /// <summary>
        /// Deletes the AutoNumber.
        /// </summary>
        /// <param name="autoNumberId">The AutoNumber identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteAutoNumber(int autoNumberId);
        #endregion

        #region Customer
        int GetPageSizeCustomers();

        /// <summary>
        /// Gets the by actives.
        /// </summary>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        /// <returns>List{CustomerModel}.</returns>
        List<CustomerModel> GetCustomersByActive(bool isActive);

        /// <summary>
        /// Gets all customers.
        /// </summary>
        /// <returns></returns>
        List<CustomerModel> GetAllCustomers(); 

        /// <summary>
        /// Gets the Customers.
        /// </summary>
        /// <returns>IList{CustomerModel}.</returns>
        IList<CustomerModel> GetCustomers(int currentPage);
        /// <summary>
        /// Gets the Customer.
        /// </summary>
        /// <param name="customerId">The Customer identifier.</param>
        /// <returns>CustomerModel.</returns>
        CustomerModel GetCustomer(int customerId);

        /// <summary>
        /// Adds the Customer.
        /// </summary>
        /// <param name="customer">The Customer.</param>
        /// <returns>System.Int32.</returns>
        string AddCustomer(CustomerModel customer);

        /// <summary>
        /// Updates the Customer.
        /// </summary>
        /// <param name="customer">The Customer.</param>
        /// <returns>System.Int32.</returns>
        string UpdateCustomer(CustomerModel customer);

        /// <summary>
        /// Deletes the Customer.
        /// </summary>
        /// <param name="customerId">The Customer identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteCustomer(int customerId);
        #endregion

        #region Department
        int GetPageSizeDepartments();

        IList<DepartmentModel> GetAllDepartments();
        /// <summary>
        /// Gets the Departments.
        /// </summary>
        /// <returns>IList{DepartmentModel}.</returns>
        IList<DepartmentModel> GetDepartments(int currentPage);
        /// <summary>
        /// Gets the Department.
        /// </summary>
        /// <param name="departmentId">The Department identifier.</param>
        /// <returns>DepartmentModel.</returns>
        DepartmentModel GetDepartment(int departmentId);

        /// <summary>
        /// Adds the Department.
        /// </summary>
        /// <param name="department">The Department.</param>
        /// <returns>System.Int32.</returns>
        string AddDepartment(DepartmentModel department);

        /// <summary>
        /// Updates the Department.
        /// </summary>
        /// <param name="department">The Department.</param>
        /// <returns>System.Int32.</returns>
        string UpdateDepartment(DepartmentModel department);

        /// <summary>
        /// Deletes the Department.
        /// </summary>
        /// <param name="departmentId">The Department identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteDepartment(int departmentId);
        #endregion

        #region InventoryItem
        List<InventoryItemModel> GetInventoryItemListByStock( int itemStock, int refId, DateTime postDate);
        int GetPageSizeInventoryItems();
        /// <summary>
        /// Gets the InventoryItems.
        /// </summary>
        /// <returns>IList{InventoryItemModel}.</returns>
        IList<InventoryItemModel> GetInventoryItems(int currentPage);

        /// <summary>
        /// Gets all inventory items.
        /// </summary>
        /// <returns></returns>
        IList<InventoryItemModel> GetAllInventoryItems();
        /// <summary>
        /// Gets the InventoryItem.
        /// </summary>
        /// <param name="inventoryItemId">The InventoryItem identifier.</param>
        /// <returns>InventoryItemModel.</returns>
        InventoryItemModel GetInventoryItem(int inventoryItemId);

        /// <summary>
        /// Adds the InventoryItem.
        /// </summary>
        /// <param name="inventoryItem">The InventoryItem.</param>
        /// <returns>System.Int32.</returns>
        string AddInventoryItem(InventoryItemModel inventoryItem);

        /// <summary>
        /// Updates the InventoryItem.
        /// </summary>
        /// <param name="inventoryItem">The InventoryItem.</param>
        /// <returns>System.Int32.</returns>
        string UpdateInventoryItem(InventoryItemModel inventoryItem);

        /// <summary>
        /// Deletes the InventoryItem.
        /// </summary>
        /// <param name="inventoryItemId">The InventoryItem identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteInventoryItem(int inventoryItemId);
        #endregion

        #region Stock
        int GetPageSizeStocks();
        /// <summary>
        /// Gets the Stocks.
        /// </summary>
        /// <returns>IList{StockModel}.</returns>
        IList<StockModel> GetStocks(int currentPage);

        /// <summary>
        /// Gets all stocks.
        /// </summary>
        /// <returns></returns>
        IList<StockModel> GetAllStocks();
        /// <summary>
        /// Gets the Stock.
        /// </summary>
        /// <param name="stockId">The Stock identifier.</param>
        /// <returns>StockModel.</returns>
        StockModel GetStock(int stockId);

        /// <summary>
        /// Adds the Stock.
        /// </summary>
        /// <param name="stock">The Stock.</param>
        /// <returns>System.Int32.</returns>
        string AddStock(StockModel stock);

        /// <summary>
        /// Updates the Stock.
        /// </summary>
        /// <param name="stock">The Stock.</param>
        /// <returns>System.Int32.</returns>
        string UpdateStock(StockModel stock);

        /// <summary>
        /// Deletes the Stock.
        /// </summary>
        /// <param name="stockId">The Stock identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteStock(int stockId);
        #endregion

        #region FixedAssetCategory

        IList<FixedAssetCategoryModel> GetAllFixedAssetCategorys(); 

        int GetPageSizeFixedAssetCategorys();
        /// <summary>
        /// Gets the FixedAssetCategorys.
        /// </summary>
        /// <returns>IList{FixedAssetCategoryModel}.</returns>
        IList<FixedAssetCategoryModel> GetFixedAssetCategorys(int currentPage);
        /// <summary>
        /// Gets the FixedAssetCategory.
        /// </summary>
        /// <param name="fixedAssetCategoryId">The FixedAssetCategory identifier.</param>
        /// <returns>FixedAssetCategoryModel.</returns>
        FixedAssetCategoryModel GetFixedAssetCategory(int fixedAssetCategoryId);

        /// <summary>
        /// Gets the accounts for combo tree.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        /// <returns>IList{AccountModel}.</returns>
        IList<FixedAssetCategoryModel> GetFixedAssetCategorysForComboTree(int FixedAssetCategoryId);

        /// <summary>
        /// Adds the FixedAssetCategory.
        /// </summary>
        /// <param name="fixedAssetCategory">The FixedAssetCategory.</param>
        /// <returns>System.Int32.</returns>
        string AddFixedAssetCategory(FixedAssetCategoryModel fixedAssetCategory);

        /// <summary>
        /// Updates the FixedAssetCategory.
        /// </summary>
        /// <param name="fixedAssetCategory">The FixedAssetCategory.</param>
        /// <returns>System.Int32.</returns>
        string UpdateFixedAssetCategory(FixedAssetCategoryModel fixedAssetCategory);

        /// <summary>
        /// Deletes the FixedAssetCategory.
        /// </summary>
        /// <param name="fixedAssetCategoryId">The FixedAssetCategory identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteFixedAssetCategory(int fixedAssetCategoryId);
        #endregion

        #region FixedAsset
        int GetPageSizeFixedAssets();
        /// <summary>
        /// Gets the FixedAssets.
        /// </summary>
        /// <returns>IList{FixedAssetModel}.</returns>
        IList<FixedAssetModel> GetFixedAssets(int currentPage);
        /// <summary>
        /// Gets the FixedAsset.
        /// </summary>
        /// <param name="stockId">The FixedAsset identifier.</param>
        /// <returns>FixedAssetModel.</returns>
        FixedAssetModel GetFixedAsset(int stockId);

        /// <summary>
        /// Adds the FixedAsset.
        /// </summary>
        /// <param name="stock">The FixedAsset.</param>
        /// <returns>System.Int32.</returns>
        string AddFixedAsset(FixedAssetModel stock);

        /// <summary>
        /// Updates the FixedAsset.
        /// </summary>
        /// <param name="stock">The FixedAsset.</param>
        /// <returns>System.Int32.</returns>
        string UpdateFixedAsset(FixedAssetModel stock);

        /// <summary>
        /// Deletes the FixedAsset.
        /// </summary>
        /// <param name="stockId">The FixedAsset identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteFixedAsset(int stockId);
        #endregion

        #region Unit

        IList<UnitModel> GetAllUnits(); 

        int GetPageSizeUnits();
        /// <summary>
        /// Gets the Units.
        /// </summary>
        /// <returns>IList{UnitModel}.</returns>
        IList<UnitModel> GetUnits(int currentPage);
        /// <summary>
        /// Gets the Unit.
        /// </summary>
        /// <param name="unitId">The Unit identifier.</param>
        /// <returns>UnitModel.</returns>
        UnitModel GetUnit(int unitId);

        /// <summary>
        /// Adds the Unit.
        /// </summary>
        /// <param name="unit">The Unit.</param>
        /// <returns>System.Int32.</returns>
        string AddUnit(UnitModel unit);

        /// <summary>
        /// Updates the Unit.
        /// </summary>
        /// <param name="unit">The Unit.</param>
        /// <returns>System.Int32.</returns>
        string UpdateUnit(UnitModel unit);

        /// <summary>
        /// Deletes the Unit.
        /// </summary>
        /// <param name="unitId">The Unit identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteUnit(int unitId);
        #endregion

        #region Vendor
        int GetPageSizeVendors();

        /// <summary>
        /// Gets the vendors by active.
        /// </summary>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        /// <returns></returns>
        List<VendorModel> GetVendorsByActive(bool isActive);

        /// <summary>
        /// Gets the Vendors.
        /// </summary>
        /// <returns>IList{VendorModel}.</returns>
        IList<VendorModel> GetVendors(int currentPage);

        /// <summary>
        /// Gets all vendors.
        /// </summary>
        /// <returns></returns>
        IList<VendorModel> GetAllVendors();
        /// <summary>
        /// Gets the Vendor.
        /// </summary>
        /// <param name="vendorId">The Vendor identifier.</param>
        /// <returns>VendorModel.</returns>
        VendorModel GetVendor(int vendorId);

        /// <summary>
        /// Adds the Vendor.
        /// </summary>
        /// <param name="vendor">The Vendor.</param>
        /// <returns>System.Int32.</returns>
        string AddVendor(VendorModel vendor);

        /// <summary>
        /// Updates the Vendor.
        /// </summary>
        /// <param name="vendor">The Vendor.</param>
        /// <returns>System.Int32.</returns>
        string UpdateVendor(VendorModel vendor);

        /// <summary>
        /// Deletes the Vendor.
        /// </summary>
        /// <param name="vendorId">The Vendor identifier.</param>
        /// <returns>System.Int32.</returns>
        string DeleteVendor(int vendorId);
        #endregion

        #region ReportList

        /// <summary>
        /// Gets the report lists.
        /// </summary>
        /// <returns>List{ReportListModel}.</returns>
        List<ReportListModel> GetReportLists();

        /// <summary>
        /// Gets the report lists by report group.
        /// </summary>
        /// <param name="reportGroupId">The report group identifier.</param>
        /// <returns>List{ReportListModel}.</returns>
        List<ReportListModel> GetReportListsByReportGroup(int reportGroupId);

        /// <summary>
        /// Gets the report list by identifier.
        /// </summary>
        /// <param name="reportListId">The report list identifier.</param>
        /// <returns>ReportListModel.</returns>
        ReportListModel GetReportListById(string reportListId);

        /// <summary>
        /// Gets the report groups.
        /// </summary>
        /// <returns>List{ReportGroupModel}.</returns>
        List<ReportGroupModel> GetReportGroups();

        /// <summary>
        /// Gets the report group by identifier.
        /// </summary>
        /// <param name="reportGroupId">The report group identifier.</param>
        /// <returns>ReportGroupModel.</returns>
        ReportGroupModel GetReportGroupById(int reportGroupId);

        #endregion

        #region Reports
        IList<StockBacklogModel> GetStockBacklog(DateTime fromDate, DateTime toDate, string stockIdList);
        #endregion                                                
    }
}